/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.tedu.mall.common.config;

public class CoolSharkStaticPrefixConfiguration {
    /*前缀命名的规则由以下部分组成:
    1.变量名都是常量大写,以_链接,例如 SPU
    2.变量名根据对应保存的业务数据javabean定义变量名称,如Spu 对应SPU_ SpuSimpleVO 对应SPU_SIMPLE_VO
    3.变量名最后全部拼接PREFIX 例如 SPU_PREFIX SPU_SIMPLE_VO_PREFIX
    4.变量名在javabean名字和PREFIX之间写业务逻辑 例如Spu锁,SPU_LOCK_PREFIX
    5.变量值都是key前缀,使用_链接,以_结束,就是变量名称小写,去掉prefix,在业务中使用后面拼接唯一值,例如
    Spu的缓存数据 public static final String SPU_PREFIX="spu_"
    6.在特殊情况下,允许业务层自定义key值*/
    public static class SpuPrefixConfiguration {
        //spu 返回对象SpuSimpleVO的前缀 后面拼接spuId
        public static final String SPU_STANDARD_VO_PREFIX = "mall:spu:standard:vo:";
        public static final String SPU_PREFIX = "spu:";
        public static final String SPU_BLOOM_FILTER_PREFIX = "spu:bloom:filter:";
    }

    public static class SkuPrefixConfiguration {
        public static final String SKU_SIMPLE_VO_PREFIX = "sku:simple:vo:";
        public static final String SKU_PREFIX = "sku:";
    }

    public static class SeckillPrefixConfiguration {
        public static final String SECKILL_RE_SECKILL_PREFIX = "mall:seckill:reseckill:";
        public static final String SECKILL_SPU_PREFIX = "mall:seckill:spu:";
        public static final String SECKILL_SPU_VO_PREFIX = "mall:seckill:spu:vo:";
        public static final String SECKILL_SPU_URL_RAND_CODE_PREFIX = "mall:seckill:spu:url:rand:code:";
        //秒杀商品库存
        public static final String SECKILL_SKU_STOCK_PREFIX = "mall:seckill:sku:stock:";
        public static final String SECKILL_SKU_VO_PREFIX = "mall:seckill:sku:vo:";
    }

    public static class AmsPrefixConfiguration {
        public static final String AMS_ADMIN_PREFIX = "mall:ams:admin:";
        public static final String AMS_ROLE_PREFIX = "mall:ams:role:";
        public static final String AMS_PERMISSION_PREFIX = "mall:ams:permission:";
        public static final String AMS_ROLE_PERMISSION_PREFIX = "mall:ams:role:permission:";
        public static final String AMS_ADMIN_ROLE_PREFIX = "mall:ams:admin:role:";
        public static final String AMS_ADMIN_LIST_PREFIX = "mall:ams:admin:list:";
        public static final String AMS_ROLE_LIST_PREFIX = "mall:ams:role:list:";
        public static final String AMS_PERMISSION_LIST_PREFIX = "mall:permission:role:list:";
    }

    public static class SmsPrefixConfiguration {
        //验证码前缀
        public static final String RAND_CODE_PREFIX = "mall:sms:code:";
        //手机号锁定前缀
        public static final String PHONE_SMS_LOCK_PREFIX = "mall:sms:code:lock:";
        //限制每分钟发送次数前缀
        public static final String CODE_SEND_LIMIT_PREFIX = "mall:sms:code:send:limit:";
        //高并发分布式锁前缀
        public static final String CODE_DISTRIBUTED_LOCK_PREFIX = "mall:sms:distributed:lock";
    }
}
